<template>
    <div>
        <div class="crumbs">
            <el-breadcrumb separator="/">
                <el-breadcrumb-item>
                    <i class="el-icon-lx-calendar"></i> 意见反馈
                </el-breadcrumb-item>
            </el-breadcrumb>
        </div>
        <div class="container">
            <div class="form-box" style="width: 300px;">
                <el-form ref="form" :model="form" label-width="100px">
                    <el-form-item label="电话号码">
                        <el-input type="textarea" rows="1" v-model="form.tel"></el-input>
                    </el-form-item>
                    <el-form-item label="意见">
                        <el-input type="textarea" rows="5" v-model="form.advice"></el-input>
                    </el-form-item>
                    <el-form-item>
                        <el-button type="primary" @click="onSubmit">提交申请</el-button>
                    </el-form-item>
                </el-form>
            </div>
        </div>
    </div>
</template>

<script>
import {addAdvice} from '../../api/index';
export default {
    name: 'baseform',
    data() {
        return {
            form: {
                advice:'',
                tel:'',
            },
            name: '',
            balance: '0',
			bank_no:'',
        };
    },
    methods: {
        onSubmit() {
			addAdvice(this.form).then(res => {
				if(res==="成功"){
					this.$message.success('提交成功！');
				}else if(res==="手机号码格式错误"){
                    this.$message.error('手机号码格式错误');
                } else {
					//未登入
					this.$message.error('提交失败！');
				}
			}).catch((e)=>{
				this.$message.error('网络异常！');
			});
        }
    }
};
</script>